{% extends base_template %}
{% load i18n xadmin_tags %}
{% load url from future %}
{% load crispy_forms_tags %}

{% block extrastyle %}{{ block.super }}
<style type="text/css">
  body {
    padding-top: 40px;
    padding-bottom: 40px;
    background-color: #f5f5f5;
  }
  .form-signin {
    max-width: 300px;
    padding: 19px 29px 29px;
    margin: 0 auto 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    -webkit-border-radius: 5px;
       -moz-border-radius: 5px;
            border-radius: 5px;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
       -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
            box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .form-signin .form-signin-heading,
  .form-signin .checkbox {
    margin-bottom: 10px;
  }
  .form-signin .control-group{
    background-color: transparent;
    border: none;
  }
  .form-signin label {
    font-size: 16px;
  }
  .form-signin input[type="text"],
  .form-signin input[type="password"] {
    font-size: 16px;
    height: auto;
    margin-bottom: 15px;
    padding: 7px 9px;
    width: 100%;
    box-sizing: border-box;
  }

  .form-signin .alert-block{
    padding: 0px;
  }
  .form-signin .alert-block ul{
    margin: 10px 15px;
  }
  .form-signin .alert-block ul li{
    list-style-type: none;
  }
</style>
{% endblock %}

{% block bodyclass %}login{% endblock %}

{% block body %}
<div class="container">

  <form action="" method="post" id="login-form" class="form-signin">
    {% csrf_token %}
    {% block login_form %}
      {% block login_heading %}
      <h2 class="form-signin-heading">{% if title %}{{title}}{% else %}{% trans "Please Login" %}{% endif %}</h2>
      {% endblock %}

      {% crispy form helper %}

      <input type="hidden" name="this_is_the_login_form" value="1" />
      <input type="hidden" name="next" value="{{ next }}" />

      <button class="btn btn-large btn-primary btn-block" type="submit">{% trans 'log in' %}</button>

      {% url 'admin_password_reset' as password_reset_url %}
      {% if password_reset_url %}
      <div class="password-reset-link">
        <a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
      </div>
      {% endif %}
    {% endblock %}
  </form>

</div> <!-- /container -->

<script type="text/javascript">
document.getElementById('id_username').focus()
</script>
{% endblock %}
